package Lesson;

public class Demo9 {
    public static void main(String[] args) {
        int[] arr = new int[10];
        test(arr);
    }

    public static  void setNum(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int)(Math.random()*20+1);
        }
    }

    public static void test(int[] arr){
        setNum(arr);
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if(i == arr.length-1){
                System.out.println(arr[i] + "]");
            }else {
                System.out.print(arr[i] + ",");
            }
        }
    }
}
